import Base from './Base'

class WechatUser extends Base {
  constructor ({
    id = '',
    openId = '',
    unionId = '',
    sex = '',
    headImgUrl = ''
  }) {
    super({id})

    this.openId = openId
    this.unionId = unionId
    this.sex = sex
    this.headImgUrl = headImgUrl
  }
  // 获取当前微信用户信息
  static async getCurrent () {
    let res = await WechatUser.$http.get(`${WechatUser.$name}/wechat/current`)
    return res
  }
}
// 静态属性
WechatUser.$name = '/user'
export default WechatUser
